package com.example.hospital.api.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.example.hospital.api.common.R;
import com.example.hospital.api.service.MedicalDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;

/**
 * @FileName MedicalDeptController
 * @folder
 * @Description
 * @Author yf
 * @return
 * @date 2024-08-19
 **/
@RestController
@RequestMapping("/medical/dept")
@Api(tags = "科室管理")
public class MedicalDeptController {
    @Resource
    private MedicalDeptService medicalDeptService;
    /**
    *
    * @folder 查询所有科室信息
    * @Param: []
    * @Author: yf
    * @return: com.example.hospital.api.common.R
    */
    @ApiOperation("查询所有科室信息")
    @GetMapping("/searchAll")
    @SaCheckLogin
    public R searchAll() {
        ArrayList<HashMap> list = medicalDeptService.searchAll();
        return R.ok().put("result",list);
    }
    @ApiOperation("查询科室和诊室信息")
    @GetMapping("/searchDeptAndSub")
    @SaCheckLogin
    public R searchDeptAndSub(){
        HashMap map = medicalDeptService.searchDeptAndSub();
        return R.ok().put("result",map);
    }
}
